<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>警告框演示</button>
    <button>选择框演示</button>
    <button>输入框演示</button>
</body>
<script>
    window.onload = function () {
        let bu = document.getElementsByTagName('button');
        bu[0].onclick = function () {
            alert('我是警告框')
        }
        bu[1].onclick = function () {
            let aa = confirm('是否确定')
            if (aa) {
                alert('确定')
            }else{
                alert('取消')
            }

        }
        bu[2].onclick = function () {
           let aa = prompt('请输入名字','Jony')
            alert('你输入的名字是：' + aa)
        }
    }
</script>

</html>